﻿@model LeadMaster.Models.Contacts

@{
    ViewBag.Title = "Edit";
}

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Edit Contact</legend>
        <div class="clearer"></div>
        @Html.HiddenFor(m => m.ContactID)
        @Html.HiddenFor(model => model.CompanyID)

        <div class="leftcolumn">
            <div class="editor-label">
                @Html.LabelFor(model => model.Salutation)
            </div>
            <div class="editor-field">
                
                @Html.TextBoxFor(model => model.Salutation, new { @class = "largetextbox" })
                @Html.ValidationMessageFor(model => model.Salutation)
            </div>

            <div class="editor-label">
                @Html.LabelFor(model => model.Forename)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(model => model.Forename, new { @class="largetextbox" })
                @Html.ValidationMessageFor(model => model.Forename)
            </div>

            <div class="editor-label">
                @Html.LabelFor(model => model.Initials)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(model => model.Initials, new { @class="largetextbox" })
                @Html.ValidationMessageFor(model => model.Initials)
            </div>

            <div class="editor-label">
                @Html.LabelFor(model => model.Surname)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Surname)
                @Html.ValidationMessageFor(model => model.Surname)
            </div>

            <div class="editor-label">
                @Html.LabelFor(model => model.Title)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Title)
                @Html.ValidationMessageFor(model => model.Title)
            </div>
       
        </div>
        <div class="rightcolumn">
            <div class="editor-label">
                @Html.LabelFor(model => model.Telephone)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Telephone)
                @Html.RadioButtonFor(model => model.DefaultTelephoneField, "Telephone")
                @Html.ValidationMessageFor(model => model.Telephone)
            </div>
                    <div class="editor-label">
                @Html.LabelFor(model => model.Tel2)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Tel2)
                @Html.RadioButtonFor(model => model.DefaultTelephoneField, "Tel2")
                @Html.ValidationMessageFor(model => model.Tel2)
            </div>

            <div class="editor-label">
                @Html.LabelFor(model => model.Mobile1)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Mobile1)
                @Html.RadioButtonFor(model => model.DefaultTelephoneField, "Mobile1")
                @Html.ValidationMessageFor(model => model.Mobile1)
            </div>

            <div class="editor-label">
                @Html.LabelFor(model => model.Mobile2)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Mobile2)
                @Html.RadioButtonFor(model => model.DefaultTelephoneField, "Mobile2")
                @Html.ValidationMessageFor(model => model.Mobile2)
            </div>

            <div class="editor-label">
                @Html.LabelFor(model => model.Email)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(model => model.Email, new { @class = "largetextbox" })
                @Html.ValidationMessageFor(model => model.Email)
            </div>

        </div>
        <div style="margin-top: 10px; float: right; clear:both;">
            <input type="submit" value="Save" class="bigsubmit" id="contactsubmit"/>
            <input type="button" value="Close" class="bigsubmit" id="closecontactedit" />
        </div>
    </fieldset>
}


@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}


<script type="text/javascript">
    $().ready(function () {

        $("#closecontactedit").click(function () {
            $("#editcontactdialog").dialog('close');
        });

    });
</script>
